<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
    
    <h:head>
        <title>#{names.title}</title>
    </h:head>
    
    <h:body rendered="#{!auth.loggedIn}">
        <ui:include src="login.xhtml" />
    </h:body>
    
    <h:body rendered="#{auth.loggedIn}">
        <h:outputStylesheet library="css" name="style.css"  />
        <h:form>
            <h:panelGroup layout="block" class="wrapper">
                <p:panel id="admin_panel" header="#{names.title}" style="margin-bottom:10px;">       
                    <ui:include src="header.xhtml" /> 
                
                    <p:panel id="edit_user_panel" header="#{names.intUserEditPanelName}" style="margin-bottom:10px;" styleClass="small">
                       <h:panelGrid columns="3">                            
                           <p:outputLabel for="username" value="#{names.intUserAttributeUsername}" />
                           <p:inputText id="username" value="#{intusers.user.username}" required="true" requiredMessage="#{names.intUserAttributeUsernameMsg}"/>  
                           <p:message for="username" />
                            <p:outputLabel for="int_password" value="#{names.intUserAttributePassword}" />
                           <p:password id="int_password" value="#{intusers.user.password}" match="int_password_confirm" required="true" requiredMessage="#{names.intUserAttributePasswordMsg}" feedback="true"/>
                           <p:message for="int_password" />
                           <p:outputLabel for="int_password_confirm" value="#{names.intUserAttributePassword}" />
                           <p:password id="int_password_confirm" value="#{intusers.user.password}" required="true" requiredMessage="#{names.intUserAttributePasswordMsg}" feedback="true"/>                        
                           <p:message for="int_password_confirm" />
                           <p:outputLabel  value="" />                               
                       </h:panelGrid>
                    </p:panel>

                   <p:panel id="buttons" style="margin-top:10px;">
                        <h:panelGrid columns="3" style="margin: 0 auto">
                            <p:commandButton id="submit" icon="ui-icon-disk" value="#{names.buttonSubmit}" ajax="false" action="#{intusers.edit}"/>
                            <p:button icon="ui-icon-close" outcome="showIntUser" value="#{names.buttonAbort}"  />  
                            <p:commandButton id="deleteButton" icon="ui-icon-minus" value="#{names.buttonDelete}" onclick="confirmation.show()" type="button" />
                            <p:confirmDialog id="confirmDialog" message="#{names.intUserDeleteConfirmBody}"  
                                    header="#{names.intUserDeleteConfirmHeader}" severity="alert" widgetVar="confirmation">  
                                <p:commandButton id="confirm" icon="ui-icon-check" value="#{names.buttonYes}" onclick="confirmation.hide()" action="#{intusers.gotoDelete}">
                                    <f:param name="self" value="#{intuser.username}" />
                                </p:commandButton>
                                <p:commandButton id="decline" icon="ui-icon-close" value="#{names.buttonNo}" onclick="confirmation.hide()" type="button" />   
                            </p:confirmDialog> 
                        </h:panelGrid>
                    </p:panel>                    

                
                
                </p:panel>
            </h:panelGroup>
        </h:form> 
    </h:body>
</html>
